package com.atxiaodei.kabudaspringannotation.demo.annotaions.configures.component;


import com.atxiaodei.kabudaspringannotation.project.dao.MyDao;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

@Configuration
@ComponentScan(value = "com.atxiaodei.kabudaspringannotation.project",
//        includeFilters = {@Filter(type = FilterType.ANNOTATION,value = {Component.class})},
        includeFilters = {@Filter(type = FilterType.ANNOTATION,value = {Controller.class,Service.class,Repository.class})},
        useDefaultFilters = false)
public class MyConfig {

    @Scope
    @Bean
    public MyDao dao(){
        return new MyDao();
    }
}
